<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTestsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tests', function (Blueprint $table) {

            $table->unsignedSmallInteger('sub_id')->comment('学科id');
            $table->string('profession',100)->unique()->comemnt('专业名称');
            $table->decimal('price',9,2)->default('0.0')->comment('价格');
            $table->decimal('sale_price',9,2)->default('0.0')->comment('优惠价格');
            $table->increments('id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tests');
    }
}
